//
// Description: 1480. 一维数组的动态和
// Created by Loading on 2021/8/28.
//

#include <bits/stdc++.h>

using namespace std;

vector<int> runningSum(vector<int> &nums) {
    // 前缀和数组
    for (int i = 1; i < nums.size(); ++i) {
        nums[i] += nums[i - 1];
    }

    return nums;
}

int main() {
    vector<int> nums = {1, 1, 1, 1, 1};
    vector<int> res = runningSum(nums);
    for (auto &x : res) {
        cout << x << " ";
    }
    cout << endl;

    return 0;
}